<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
<script src="https://cdn.bootcss.com/stomp.js/2.3.3/stomp.js"></script>
<script src="https://cdn.bootcss.com/sockjs-client/1.4.0/sockjs.js"></script>
</head>
<body>
	<br>${id}
	<div id="msg"></div>
</body>

<script>
	var id = "${id}";
	var sockJs = new SockJS("http://127.0.0.1:8866/socket");
	var stompClient = Stomp.over(sockJs);
	stompClient.connect({}, function(data) {
		/* 订阅服务端发来的消息 */
		stompClient.subscribe("/user/" + id + "/test-msg-to-user", function(
				response) {
			$("#msg").append(response.body+'<br/>');
		})

	})
</script>
</html>